home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: uu4news.netcom.com!zodiac!szh
- From: szh@zcon.com (Syed Zaeem Hosain)
- Subject: Re: Binary files ?
- Message-ID: <1996Feb25.165110.7858@zcon.com>
- Sender: szh@zcon.com (Syed Zaeem Hosain)
- Nntp-Posting-Host: zodiac
- Reply-To: szh@zcon.com
- Organization: Z Consulting Group
- References: <Pine.SV4.3.91-heb-2.04.960224055809.17461A-100000@cs.technion.ac.il>
- Date: Sun, 25 Feb 1996 16:51:10 GMT
-
- In article <Pine.SV4.3.91-heb-2.04.960224055809.17461A-100000@cs.technion.ac.il>, Kohn Emil Dan <emild@cs.technion.ac.il> writes:
- >Just open the file using "rb" for reading and "wb" for writing, (instead
- >of "r", and "w" respectively, and everything will be ok.
- >
- >In UNIX, there is no difference between text and binary files, a file is
- >a stream of bytes. In DOS, the situation is much stranger, I think he
- >expands \n to \n\r, and puts an EOF (CTRL-Z) at the end of file, when a
- >file is opened in text mode.
-
- There is no *automatic* insertion of a control-Z byte at the end of the
- file when it is opened and closed in text mode in DOS. This is up to you
- to do *if* you want to, but it is not necessary or required by DOS.
-
- Also, for what it is worth, the definition of EOF in C (found in stdio.h)
- is not CTRL-Z.
-
- >And last, but not least: main() returns int, not void...
-
- Yes!
-
- Z
-
-
- --
- -------------------------------------------------------------------------
- | Syed Zaeem Hosain P. O. Box 610097 (408) 441-7021 |
- | Z Consulting Group San Jose, CA 95161 szh@zcon.com |
- -------------------------------------------------------------------------
-